home *** CD-ROM | disk | FTP | other *** search
/ Programming Sound Cards / Programming Sound Cards.iso / sound_65 / readme < prev    next >
Text File  |  1995-01-01  |  5KB  |  92 lines

  1. This is a set of C++ source code to allow PC programmers to make use of the
  2. Sound Blaster card, in particular the digitised sample recording and playback
  3. modes. It uses classes so that your code can be independent of the particular
  4. sound driver being used; the only driver included is for the SB card but it
  5. is easy to add others. The driver supports version 2.0 of the Sound Blaster,
  6. meaning that you can achieve a 44kHz playback rate and can record at 15kHz.
  7. A feature of the software is that it supports double-buffered DMA routines
  8. implemented within a single memory area - basically this means you can have
  9. continuous playback (or recording) while doing something else, (accessing
  10. the disk, updating the screen, etc).
  11.  
  12. The device-independent class is called SoundDevice. As well as providing
  13. virtual functions for access to derived classes, it contains two useful
  14. functions of its own. The first is file_dma, which lets you play sound files
  15. of unlimited length straight from the hard disk. This makes full use of the
  16. double buffering, and also keeps statistics on the length of time needed to
  17. access the disk so that you can keep an eye on its progress and see how much
  18. time is spare. The other function is monitor_input, which displays a bar
  19. graph along the top of the screen representing the input levels coming from
  20. the Sound Blaster. If it reaches 80 characters then you know that you've
  21. hit the maximum input level (255).
  22.  
  23. The SB-specific class is called SbDevice. It is derived from SoundDevice, so
  24. you don't need to call it directly. If you are simply looking for information
  25. about the details of programming the SB card, you will find everything in
  26. there. If you intend to use the class you might want to modify some of the
  27. functions, particularly process_keys which defines what action is taken if
  28. a key is pressed during the DMA wait.
  29.  
  30. Two demonstration programs are provided. The first is play_rec.exe which
  31. will play/record sample files through the Sound Blaster using the file_dma
  32. function. You can select any sample rate using the "-s" option. Note that
  33. this isn't a proper .voc or .wav file player. It doesn't read any specific
  34. file format headers - it just plays the whole file, so you might hear some
  35. strange noise at the beginning if you're not playing a raw sound file.
  36.  
  37. The second program is monitor.exe, which (you guessed it) just uses the
  38. SoundDevice monitor_input function to give you a real-time display of your
  39. sound input.  Note that you can also set the sampling rate in this program,
  40. which will change the rate of update of the display.
  41.  
  42.  
  43. Acknowledgements
  44.  
  45. Much of the specific SB programming details (and some of the code) came from
  46. the Sound Blaster Freedom Project, available as /pub/msdos/sound/sbf?.zip
  47. (where ? is the version number). In particular the dma_code.asm file originated
  48. from there (although I have since modified it) and a few parts of SbDevice.cpp
  49. contain SBF code. You might like to take a look at the SBF package as a source
  50. of further information about the Sound Blaster.
  51.  
  52.  
  53. Distribution policy
  54.  
  55. You may freely examine/use/modify/distribute this software, as long as you
  56. leave all attributions intact (ie you can't replace my name with yours and
  57. redistribute it). If you release any software which is based on (or uses
  58. ideas from) my code, please include an acknowledgement either in the
  59. documentation, or the program itself.
  60.  
  61.  
  62. File contents
  63.  
  64. readme           You're reading it
  65. sounddev.cpp     SoundDevice class
  66. sbdevice.cpp     SbDevice class
  67. sndclass.h       Definitions for all the sound class functions
  68. dma_code.asm     Assembly code for the DMA controller
  69. play_rec.cpp     Source file for play_rec.exe
  70. play_rec.exe     The first demo program
  71. monitor.cpp      Source for monitor.exe
  72. monitor.exe      The second demo program
  73. makefile         How to rebuild the software
  74.  
  75. The programs are designed for use with Borland C++. If you're using another
  76. compiler you might have to make a few changes. Note that dma_code.asm uses
  77. the "Ideal" mode of TASM, which won't go down too well with MASM.
  78.  
  79. The tab size is meant to be set to something small (eg 2 or 4). Also, make
  80. sure you select a far data pointer model such as compact or large.
  81.  
  82.  
  83. Author
  84.  
  85. Christopher M. Box
  86. Computer Science Department
  87. University of Warwick, England.
  88.  
  89. From October 1993 until July 1996, you should be able to contact me
  90. indirectly by sending mail to 'J.M.Box@warwick.ac.uk', who will know my
  91. current address.
  92.